#_*_ coding:utf-8 _*
import wx
# 导入 wxPython
class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        super().__init__(parent, title=title, size=(300, 200))

        # 创建面板
        panel = wx.Panel(self)

        # 创建标签
        self.label = wx.StaticText(panel, label="欢迎使用 wxPython GUI 程序！", pos=(20, 20))

        # 创建按钮
        button = wx.Button(panel, label="点击我", pos=(20, 60))
        button.Bind(wx.EVT_BUTTON, self.on_button_click)

        self.Centre()
        self.Show()

    def on_button_click(self, event):
        self.label.SetLabel("按钮被点击了！")


if __name__ == '__main__':
    app = wx.App()
    frame = MyFrame(None, "简单的 wxPython 程序")
    app.MainLoop()